<%--

  Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the latest version of the GNU Lesser General
  Public License as published by the Free Software Foundation;

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with this program (LICENSE.txt); if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

--%>
<%@ page errorPage="/WEB-INF/jsp/error.jsp"
    contentType="text/html; charset=utf-8"
%>
<%String type = request.getParameter("type");  %>
<%@ include file="page-init.jsp" %>
<%@ page import="org.jamwiki.model.*,org.jamwiki.utils.*" %>
 
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td width="0" class="word-orange" align="center"><%@ include file="navigation-menu.jsp" %></td>   
           </tr>  
      </table>
      <form name="searchForm" method="post" action="<jamwiki:link value="Special:Search" />">
        <br/>
       <table width="98%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="2%">&nbsp;</td>
            <td width="25%" align="center">搜索：
              <label>
              <input name="text" type="text" class="input" />
              &nbsp;<input type="image" src="<%=imagePath %>ico-search.gif" width="17" height="17" align="absmiddle" name="search" value='<f:message key="generalmenu.search"/>'/></label></td>
            
            <%if(ServletUtil.isEdit()){ %>
            <td width="2%" align="center"><img src="<%=imagePath %>right-line02.gif" width="2" height="16" /></td>
            <td width="9%" align="center"><a href="<%=basePath %>en/Special:CreateTopic"><img src="<%=imagePath %>b-write.gif" width="48" height="18" border="0"/></a></td>
             <td width="2%" align="center"><img src="<%=imagePath %>right-line02.gif" width="2" height="16" /></td>
            <%}else{ %>
            <td width="2%" align="center">&nbsp;</td>
            <td width="9%" align="center">&nbsp;</td>
            <td width="2%" align="center">&nbsp;</td>
            <%} %>
            
            <td width="40%" align="right"><a href="<%=basePath %>en/Special:Allpages?type=public&num=<%=WikiUtil.percount %>&offset=0"   class="<%if("public".equals(type)){ %>txt-blue<%}else{ %><%} %>"><strong>已发布主题</strong></a>&nbsp;  |  &nbsp;<a href="<%=basePath %>en/Special:Allpages?type=nonpublic&num=<%=WikiUtil.percount %>&offset=0" class="<%if("nonpublic".equals(type)){ %>txt-blue<%}else{ %><%} %>">未发布主题</a></td>
          </tr>
        </table>
        </form>
     <table width="98%"><tr><td>
		 <div id="change">



<c:if test="${!empty message}"><div class="message"><f:message key="${message.key}"><f:param value="${message.params[0]}" /></f:message></div></c:if>

<c:if test="${empty changes}"><div class="message"><f:message key="watchlist.caption.empty" /></div></c:if>

<c:if test="${!empty changes}">

<form name="num-changes" method="get" action="<jamwiki:link value="Special:Watchlist" />">

<%-- FIXME: do not hardcode date pattern --%>
<c:set var="previousDate"><f:formatDate value="${changes[0].editDate}" type="both" pattern="yyyy-MM-dd" /></c:set>
<table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#dddddd">
          <tr>
            <td height="25" colspan="4" align="left" background="<%=imagePath %>right-bg03.gif" bgcolor="#FFFFFF"><label><h4>&nbsp;<c:out value="${previousDate}" /></h4></label></td>
          </tr>        
 </table>

<c:forEach items="${changes}" var="change">
<c:set var="currentDate"><f:formatDate value="${change.editDate}" type="both" pattern="yyyy-MM-dd" /></c:set>
<c:if test="${currentDate != previousDate}">

<table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#dddddd">
          <tr>
            <td height="25" colspan="4" align="left" background="<%=imagePath %>right-bg03.gif" bgcolor="#FFFFFF"><label><h4>&nbsp;<c:out value="${currentDate}" /></h4></label></td>
          </tr>        
 </table>
</c:if>
    <table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#dddddd">
          <tr class="table-tr1">
            <td width="4%" height="25" align="center" bgcolor="#FFFFFF" class="table-tr1"><img src="<%=imagePath %>Forum_readme.gif" width="10" height="10"></td>
            <td width="51%" align="left" bgcolor="#FFFFFF" class="table-tr1">
              <c:if test="${!change.delete}"><jamwiki:link value="${change.topicName}" text="${change.simpleName}" /></c:if>
	          <c:if test="${change.delete}"><c:out value="${change.simpleName}" /></c:if>
            </td>
            <td width="17%" align="left" bgcolor="#FFFFFF" class="table-tr1"><f:formatDate value="${change.editDate}" type="both" pattern="yyyy-MM-dd" /></td>
            <td width="28%" align="left" bgcolor="#FFFFFF" class="table-tr1" class="txt-blue">
              <jamwiki:link value="Special:Diff"><jamwiki:linkParam key="topic" value="${change.topicName}" /><jamwiki:linkParam key="version2"><c:out value="${change.previousTopicVersionId}" /></jamwiki:linkParam><jamwiki:linkParam key="version1" value="${change.topicVersionId}" /><f:message key="common.caption.diff" /></jamwiki:link>
              &nbsp;|&nbsp;
              <jamwiki:link value="Special:History"><jamwiki:linkParam key="topic" value="${change.topicName}" /><f:message key="common.caption.history" /></jamwiki:link>
              &nbsp;|&nbsp;
              <jamwiki:link value="${change.topicName}?show=false"><f:message key="recentchanges.caption.comments" /></jamwiki:link>
               &nbsp;|&nbsp;
               <jamwiki:link value="Special:Contributions"><jamwiki:linkParam key="contributor" value="${change.authorName}" /><f:message key="recentchanges.caption.contributions" /></jamwiki:link>
            </td>
          </tr>
        </table>

<c:set var="previousDate" value="${currentDate}" />
</c:forEach>
</ul>
</form>
</c:if>
<div class="message"><f:message key="common.caption.view" />: <jamwiki:pagination total="${numChanges}" rootUrl="Special:Watchlist" /></div>
</div>
		</td></tr></table>
